package com.sgb.kjwl.view.ui.adapter.supplier3;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.BossEntity;
import com.sgb.kjwl.model.entity.supplier3.SupplierEntity3;
import com.sgb.kjwl.model.entity.supplier3.SupplierRecommendEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

/**
 * @author Administrator
 */
public class SupplierRecommendAdapter extends BaseRecycleAdapter<SupplierRecommendEntity> {

    public SupplierRecommendAdapter(Context context, List<SupplierRecommendEntity> datas) {
        super(context, R.layout.item_supplier_recommend, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final SupplierRecommendEntity entity) {
        if (TextUtils.isEmpty(entity.getAuthYear())) {
            holder.getView(R.id.authYear).setVisibility(View.GONE);
        } else {
            holder.getView(R.id.authYear).setVisibility(View.VISIBLE);
        }
        holder.setBinding(BR.viewModel, entity);

        if ("1".equals(entity.getSelfSupportTag())) {
            holder.setVisible(R.id.image_ziying, true);
        } else {
            holder.setVisible(R.id.image_ziying, false);
        }
    }

}
